package com.ruoyi.db.oms.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 订单商品对象 oms_order_goods
 *
 * @author yfy
 * @date 2020-04-25
 */

@ApiModel("订单商品实体类")
@Data
@EqualsAndHashCode(callSuper=true)
public class OmsOrderGoods extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("订单商品ID")
    private Long id;

    @ApiModelProperty("订单ID")
    @Excel(name = "订单ID")
    @NotBlank(message = "订单ID不能为空")
    private Long orderId;

    @ApiModelProperty("商品ID")
    @Excel(name = "商品ID")
    @NotBlank(message = "商品ID不能为空")
    private Long goodsId;

    @ApiModelProperty("商品名称")
    @Excel(name = "商品名称")
    @NotBlank(message = "商品名称不能为空")
    @Size(min = 0, max = 127, message = "商品名称长度不能超过127个字符")
    private String goodsName;

    @ApiModelProperty("商品编号")
    @Excel(name = "商品编号")
    @NotBlank(message = "商品编号不能为空")
    @Size(min = 0, max = 63, message = "商品编号长度不能超过63个字符")
    private String goodsSn;

    @ApiModelProperty("货品ID")
    @Excel(name = "货品ID")
    @NotBlank(message = "货品ID不能为空")
    private Long productId;

    @ApiModelProperty("购买数量")
    @Excel(name = "购买数量")
    @NotBlank(message = "购买数量不能为空")
    private Integer number;

    @ApiModelProperty("售价")
    @Excel(name = "售价")
    @NotBlank(message = "售价不能为空")
    private BigDecimal price;

    @ApiModelProperty("规格列表")
    @Excel(name = "规格列表")
    @NotBlank(message = "规格列表不能为空")
    @Size(min = 0, max = 1023, message = "规格列表长度不能超过1023个字符")
    private String specifications;

    @ApiModelProperty("商品货品或商品图片")
    @Excel(name = "商品货品或商品图片")
    @NotBlank(message = "商品货品或商品图片不能为空")
    @Size(min = 0, max = 255, message = "商品货品或商品图片长度不能超过255个字符")
    private String picUrl;

    @ApiModelProperty("订单商品评论（-1超期不能评价 0可以评价 其他值是comment表里面的评论ID）")
    @Excel(name = "订单商品评论", readConverterExp = "-=1超期不能评价,0=可以评价,其=他值是comment表里面的评论ID")
    private Long comment;

    @ApiModelProperty("创建时间")
    private LocalDateTime addTime;

    @ApiModelProperty("逻辑删除")
    private Integer deleted;
}
